﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace OMDR
{
    /// <summary>
    /// Logique d'interaction pour SpecificObjectifScreen.xaml
    /// </summary>
    public partial class SpecificObjectifScreen : Page
    {
        public SpecificObjectifScreen()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, RoutedEventArgs e)
        {
            String locName;
            String locDescription;
            String locType;
            int locPhase;
            String locProcess;

            locName = nomSpecificObjectif.Text;
            locDescription = descriptionSpecificObjectif.Text;
            locType = typeSpecificObjectif.Text;
            locPhase = Convert.ToInt32(phaseSpecificObjectif.Text);
            locProcess = processusSpecificObjectif.Text;

            Objective locObjective = new Objective(locName, locDescription, locType, locPhase, locProcess);

            DataManager locDataManager = DataManager.getInstance;
            locDataManager.setObjective(locObjective);

            TransactionManager locTransactionManager = TransactionManager.getInstance;
            locTransactionManager.setObjectiveInDB(locObjective);
        }
    }
}
